package org.zoffy.commons;

public enum StatusCode {
    SUCCESS(0, "成功"),
    UNKNOWN_EXCEPTION(400, "未知异常"),
    PARAMS_ERROR(40000, "请求参数错误"),
    NOT_LOGIN_ERROR(40100, "未登录"),
    LOGIN_PARAMS_ERROR(40101, "用户名或密码错误"),
    NO_AUTH_ERROR(40110, "无权限"),
    NOT_FOUND_ERROR(40400, "请求数据不存在"),
    FORBIDDEN_ERROR(40300, "禁止访问"),
    SYSTEM_ERROR(50000, "系统内部异常"),
    OPERATION_ERROR(50001, "操作失败"),
    DATABASE_ERROR(50002, "数据库错误");
    private final Integer code;
    private final String msg;
    StatusCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public Integer getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
}
